home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Resources / Chat & Communication / Digsby build 37 / digsby_setup.exe / lib / tests / unittests / imagetests.pyo (.txt) < prev    next >
Python Compiled Bytecode  |  2008-10-13  |  6KB  |  207 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.5)
  3.  
  4. from common.MultiImage import compute_anchor_position
  5. from util import to_storage
  6. import unittest
  7.  
  8. class ImageTestingSuite(unittest.TestCase):
  9.     
  10.     def testcompute_anchor_position01(self):
  11.         anchor = to_storage(dict(halign = 'center', valign = 'center'))
  12.         size = [
  13.             200,
  14.             200]
  15.         offset = [
  16.             0,
  17.             0]
  18.         pos = compute_anchor_position(anchor, size, offset)
  19.         self.assertEqual(pos, (100, 100))
  20.  
  21.     
  22.     def testcompute_anchor_position02(self):
  23.         anchor = to_storage(dict(halign = 'right', valign = 'bottom', offset = [
  24.             -20,
  25.             -10]))
  26.         size = [
  27.             200,
  28.             200]
  29.         offset = [
  30.             0,
  31.             0]
  32.         pos = compute_anchor_position(anchor, size, offset)
  33.         self.assertEqual(pos, (180, 190))
  34.  
  35.     
  36.     def testcompute_anchor_position03(self):
  37.         anchor = to_storage(dict(halign = 'right', valign = 'top', offset = [
  38.             20,
  39.             36]))
  40.         size = [
  41.             200,
  42.             200]
  43.         offset = [
  44.             0,
  45.             0]
  46.         pos = compute_anchor_position(anchor, size, offset)
  47.         self.assertEqual(pos, (220, 36))
  48.  
  49.     
  50.     def testcompute_anchor_position04(self):
  51.         anchor = to_storage(dict(offset = [
  52.             15,
  53.             34]))
  54.         size = [
  55.             200,
  56.             200]
  57.         offset = [
  58.             0,
  59.             0]
  60.         pos = compute_anchor_position(anchor, size, offset)
  61.         self.assertEqual(pos, (15, 34))
  62.  
  63.     
  64.     def testcompute_anchor_position05(self):
  65.         anchor = to_storage(dict(halign = 'right', valign = 'bottom', offset = [
  66.             '-20%',
  67.             '-10%']))
  68.         size = [
  69.             200,
  70.             200]
  71.         offset = [
  72.             0,
  73.             0]
  74.         pos = compute_anchor_position(anchor, size, offset)
  75.         self.assertEqual(pos, (160, 180))
  76.  
  77.     
  78.     def testcompute_anchor_position06(self):
  79.         anchor = to_storage(dict(halign = 'right', valign = 'top', offset = [
  80.             '20%',
  81.             '36%']))
  82.         size = [
  83.             200,
  84.             200]
  85.         offset = [
  86.             0,
  87.             0]
  88.         pos = compute_anchor_position(anchor, size, offset)
  89.         self.assertEqual(pos, (240, 72))
  90.  
  91.     
  92.     def testcompute_anchor_position07(self):
  93.         anchor = to_storage(dict(offset = [
  94.             '15%',
  95.             '34%']))
  96.         size = [
  97.             200,
  98.             200]
  99.         offset = [
  100.             0,
  101.             0]
  102.         pos = compute_anchor_position(anchor, size, offset)
  103.         self.assertEqual(pos, (30, 68))
  104.  
  105.     
  106.     def testcompute_anchor_position08(self):
  107.         anchor = to_storage(dict(halign = 'right', valign = 'bottom', offset = [
  108.             -20,
  109.             '-10%']))
  110.         size = [
  111.             200,
  112.             200]
  113.         offset = [
  114.             0,
  115.             0]
  116.         pos = compute_anchor_position(anchor, size, offset)
  117.         self.assertEqual(pos, (180, 180))
  118.  
  119.     
  120.     def testcompute_anchor_position09(self):
  121.         anchor = to_storage(dict(halign = 'right', valign = 'top', offset = [
  122.             '20%',
  123.             36]))
  124.         size = [
  125.             200,
  126.             200]
  127.         offset = [
  128.             0,
  129.             0]
  130.         pos = compute_anchor_position(anchor, size, offset)
  131.         self.assertEqual(pos, (240, 36))
  132.  
  133.     
  134.     def testcompute_anchor_position10(self):
  135.         anchor = to_storage(dict(offset = [
  136.             15,
  137.             '34%']))
  138.         size = [
  139.             200,
  140.             200]
  141.         offset = [
  142.             0,
  143.             0]
  144.         pos = compute_anchor_position(anchor, size, offset)
  145.         self.assertEqual(pos, (15, 68))
  146.  
  147.     
  148.     def testcompute_anchor_position11(self):
  149.         anchor = to_storage(dict(offset = [
  150.             '15%',
  151.             -34]))
  152.         size = [
  153.             200,
  154.             200]
  155.         offset = [
  156.             0,
  157.             0]
  158.         pos = compute_anchor_position(anchor, size, offset)
  159.         self.assertEqual(pos, (30, -34))
  160.  
  161.     
  162.     def testcompute_anchor_position12(self):
  163.         anchor = to_storage(dict(halign = 'center', valign = 'center', offset = [
  164.             '15%',
  165.             -34]))
  166.         size = [
  167.             200,
  168.             200]
  169.         offset = [
  170.             0,
  171.             0]
  172.         pos = compute_anchor_position(anchor, size, offset)
  173.         self.assertEqual(pos, (130, 66))
  174.  
  175.     
  176.     def testcompute_anchor_position13(self):
  177.         anchor = to_storage(dict(halign = 'center', valign = 'center', offset = [
  178.             '15%',
  179.             -34]))
  180.         size = [
  181.             200,
  182.             200]
  183.         offset = [
  184.             20,
  185.             20]
  186.         pos = compute_anchor_position(anchor, size, offset)
  187.         self.assertEqual(pos, (150, 86))
  188.  
  189.     
  190.     def testcompute_anchor_position14(self):
  191.         anchor = to_storage(dict(halign = 'center', valign = 'center', offset = [
  192.             '15%',
  193.             -34]))
  194.         size = [
  195.             200,
  196.             200]
  197.         offset = [
  198.             20,
  199.             -20]
  200.         pos = compute_anchor_position(anchor, size, offset)
  201.         self.assertEqual(pos, (150, 46))
  202.  
  203.  
  204. if __name__ == '__main__':
  205.     unittest.main()
  206.  
  207.